home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / filecomp.zip / FILECOMP.DOC < prev   
Text File  |  1987-02-02  |  4KB  |  79 lines

  1.  
  2.                                FILECOMP
  3.  
  4.     PROBLEM:  We needed a good way of comparing two different text files for
  5. similarities/differences on a line-by-line, character-by-character basis.
  6. DOS comes w/ the COMP command; errors are reported in terms of byte-offsets.
  7. Our keypunchers needed errors reported in terms of columns. Also needed was
  8. variable line-lengths, i.e., only some portion of each line needed to be
  9. created.
  10.  
  11.     SOLUTION: We wrote our own text-comparison program in Turbo Pascal:
  12. FILECOMP.
  13.  
  14.     FEATURES: Error-checking: will not accept the same filename for the two
  15. files to be checked, checks to see if specified files exist
  16.  
  17.               Diagnostics: After checking each from a file to another, should
  18. there be descrepancies, the output would be:
  19.  
  20. vvvvvvvvvvvvvvvvvvvvvvvvvvvv SAMPLE OUTPUT vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  21.  
  22. LINE 1:
  23. this is a line of data from the first file.
  24. ....+....1....+....2....+....3..||||||||||||
  25. this is a line of data from the second file.
  26.  
  27. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SAMPLE OUTPUT ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  28.  
  29. In the above example, the first line is the line number of the first file.
  30. The second and fourth lines are actual lines from the two files, up to the
  31. specified line-length. The third line is a grid to help gauge the column #'s.
  32. The tenth columns are demarked w/ a corresponding integer, e.g., '5' is the
  33. fiftieth column. The fifth columns are denoted w/ a '+', e.g., a '+' between
  34. the twentieth and thirtieth columns is the 25th column. Any '.'s are just
  35. the other columns. All of the markings are superseded by a '|' if the corresponding
  36. column contains different values for the two files, e.g., in the above output
  37. the first error occurs in column 33. Users of IBM's XEDIT and Mansfield
  38. Software's KEDIT will recognize this grid as the "scale".
  39.     At the end of the diagnostic output, the # of total errors, the average
  40. errors per line, and the total line-lengths from both files is reported. A
  41. further warning message is printed if the two files are of unequal length.
  42.  
  43.               Output Device: Three are available, Your printer (the device
  44. attached to the default list device), your screen (the device attached to
  45. the default terminal-output), and a text file, ("output.txt").
  46.  
  47.  
  48.     USEAGE: controlled via command-line arguments:
  49.          filecomp w x y z
  50.               where:
  51.                         w = where output will be printed:
  52.                             0:printer, 1: output.txt file, default: screen
  53.                         x = # of columns to read for each line (max = 255).
  54.                             If any line is shorter than the specified line
  55.                             length, the comparison is made w/ padded blanks.
  56.                         y & z = two DOS filenames to be compared. Include
  57.                             drive & pathname either if not in current directory.
  58.  
  59.  
  60.  
  61.     RULES FOR USE OF FILECOMP: FILECOMP is distributed "as-is" and only through
  62. public-domain channels. No one person or organization may re-distribute
  63. FILECOMP as part of a "bundling" deal, i.e., FILECOMP cannot be
  64. re-distributed by any means whereby a user would have to purchase either
  65. another program or would have to purchase the service of providing
  66. FILECOMP. FILECOMP was written strictly for users of the public domain
  67. software, as a way of paying back other software authors from whom I've
  68. benefited. Only the source code for FILECOMP costs ($5). If You are
  69. interested in obtaining the source code, or if any organization or person is
  70. interested in "bundling" FILECOMP, please contact:
  71.  
  72.                      R.Rasulis Consulting Services
  73.                                  c/o:
  74.                  BITNET: SMGGYUC.BOSTONU.WISCVM.BITNET
  75.                         COMPUSERVE: 76347,1021
  76.                           GEnie: R.RASULIS
  77.                SNAILNET: 1961 Commonwealth Ave., Suite 5
  78.                           Boston, Mass. 02135
  79.